﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>消息推送 </title>
    <script type="text/javascript">
        //删除.
        function Del(mypk, nodeid) {
            if (mypk == '') {
                alert("默认发送不允许删除，您可以修改。");
                return;
            }
            if (window.confirm('您确定要删除吗?') == false)
                return;
            window.location.href = 'PushMessage.htm?MyPK=' + mypk + '&DoType=Del&FK_Node=' + nodeid;
        }
    </script>
    <link href="../../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../../Scripts/bootstrap/js/jquery.min.js"></script>
    <script src="../../../Scripts/QueryString.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../../Scripts/config.js"></script>
    <script type="text/javascript" src="../../../Comm/Gener.js"></script>

    <base target="_self" />
    <script type="text/javascript">
        function Esc() {
            if (event.keyCode == 27)
                window.close();
            return true;
        }
         
        /*隐藏与显示.*/
        function ShowHidden(ctrlID) {

            var ctrl = document.getElementById(ctrlID);
            if (ctrl.style.display == "block") {
                ctrl.style.display = 'none';
            } else {
                ctrl.style.display = 'block';
            }
        }
    </script>

    <script type="text/javascript" language="javascript">
        //页面启动函数.
        $(function () {

            var ens = new Entities("BP.Sys.MapExts");
            ens.Retrieve("FK_MapData", GetQueryString("FK_MapData"),
            "ExtType", "BindFunction", "AttrOfOper", GetQueryString("KeyOfEn"));

            for (var i = 0; i < ens.length; i++) {

                var en = new Entity("BP.Sys.MapExt", ens[i]);

                var newRow = "";
                newRow = "<tr ><td class=Idx>" + (i + 1) + "</td>";
                newRow += "<td><a href='BindFunctionEntity.htm?&FK_Event=" + en.Tag + "&MyPK=" + en.MyPK + "&FK_Node=" + en.FK_Node + "'>" + en.Tag + "</a></td>";
                newRow += "<td>" + en.Doc + "</td>";
                newRow += "<td>" + en.Tag1 + "</td>";
                newRow += "<td><a href=\"javascript:Delete('" + en.MyPK + "')\"><img src='/WF/Img/Btn/Delete.gif' border=0 />删除</a>";
                newRow += "</td>";
                newRow += "</tr>";

                $("#Table1 tr:last").after(newRow);
            }
        });
       

        function PushWayText(EventListOfNode,PushWay) {
            var ret = { "onblur": ["不发送", "发送给当前节点的所有处理人", "向指定的字段发送", "其他节点的处理人"],
                "onchange": ["不发送", "发送给下一个节点的所有接受人", "向指定的字段发送", "其他节点的处理人"],
                "onclick": ["不发送", "发送给被退回的节点处理人", "向指定的字段发送", "其他节点的处理人"],
                "ondblclick": ["不发送", "撤销工作后通知的节点接受人", "向指定的字段发送", "其他节点的处理人"],
                "onkeypress": ["不发送", "流程结束通知的所有流程的参与人", "向指定的字段发送", "其他节点的处理人"],
                "onkeyup": ["不发送", "流程删除后通知所有流程的参与人", "向指定的字段发送", "其他节点的处理人"]
            };
            return ret[EventListOfNode][PushWay];
        }

        function Delete(myPK) {

            if (window.confirm('您确定要删除吗？') == false)
                return;
            var en = new Entity("BP.Sys.MapExt");
            en.MyPK = myPK;
            en.Delete();
            window.location.href = window.location.href;
        }

        function Btn_Save_Click() {

            var formData = new FormData($("#cc")[0]);

            $.ajax({
                url: Handler + "?DoType=Bill_Save&CheckBoxIDs=" + "&FK_Node=" + GetQueryString("FK_Node") + "&m=" + Math.random(),
                type: 'POST',
                data: formData,
                async: false,
                cache: false,
                contentType: false,
                processData: false,
                success: function (data) {

                    if (data.indexOf('err@') >= 0) {
                        alert(data);
                        return;
                    }

                    alert(data);
                    window.location.href = window.location.href;
                    return;
                }
            });
        }

        function BindFunctionEntity(eventType) {
            var url = 'BindFunctionEntity.htm?FK_MapData=' + GetQueryString('FK_MapData');
            url += '&FK_Event=' + eventType;
            url += '&KeyOfEn=' + GetQueryString("KeyOfEn");
            url += '&tk=' + Math.random();
            window.location.href = url;
        }
    </script>

    <style type="text/css">
    li 
    {
        padding:3px 0;
        }
    </style>
    
</head>
<body onkeypress="Esc();" style="font-size: smaller">
    <form method="post"   id="form1">    
    <div style="margin:8px">
        <table id="Table1" style="width: 100%">
            <caption>
                <div style="float: left"> 控件绑定function</div>
                <div style="float: right"> <a href="http://ccbpm.mydoc.io" target="_blank">帮助</a>  </div>
            </caption>
            <tr>
                <th> 序 </th>
                <th> 事件标记 </th>
                <th> 函数名称 </th>
                <th> 备注 </th>
                <th>操作 </th>
            </tr>
        </table>
        <fieldset style="border: 0px;">
        <input type="button" value="新建消息" id="Btn_Save" onclick="ShowHidden('state')" />&nbsp;&nbsp; 
            <div id="state" style="display: none; color: Gray">
                <ul>
                    <li><a href="javascript:BindFunctionEntity('blur');">onblur - 失去焦点</a> </li>
                    <li><a href="javascript:BindFunctionEntity('change');">onchange - 内容变化</a> </li>
                    <li><a href="javascript:BindFunctionEntity('click');">onclick - 单击</a> </li>
                    <li><a href="javascript:BindFunctionEntity('dblclick');">ondblclick - 双击</a> </li>
                    <li><a href="javascript:BindFunctionEntity('keypress');">onkeypress - 按下键盘</a> </li>
                    <li><a href="javascript:BindFunctionEntity('keyup');">onkeyup - 按上键盘</a> </li>
                </ul>
            </div>
        </fieldset>
    </div>
    </form>
</body>
</html>
